﻿<UserControl x:Class="DemoBehaviors1.ucMainGame"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:Microsoft_Expression_Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
    xmlns:Spritehand_PhysicsBehaviors="clr-namespace:Spritehand.PhysicsBehaviors;assembly=Spritehand.PhysicsBehaviors" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:DemoBehaviors1" 
    mc:Ignorable="d"
    d:DesignHeight="480" d:DesignWidth="800">
	<UserControl.Resources>
		<Storyboard x:Name="sbAnimateWater" RepeatBehavior="Forever">
			<PointAnimationUsingKeyFrames Storyboard.TargetProperty="(Path.Data).(PathGeometry.Figures)[0].(PathFigure.StartPoint)" Storyboard.TargetName="rectWater">
				<EasingPointKeyFrame KeyTime="0" Value="13.0727027157942,6.4996592203776"/>
				<EasingPointKeyFrame KeyTime="0:0:0.4" Value="13.0730495452881,0.5"/>
				<EasingPointKeyFrame KeyTime="0:0:2" Value="192.406005859375,1.16632588704427"/>
				<EasingPointKeyFrame KeyTime="0:0:2.9" Value="191.739339192708,6.49965922037761"/>
			</PointAnimationUsingKeyFrames>
			<PointAnimationUsingKeyFrames Storyboard.TargetProperty="(Path.Data).(PathGeometry.Figures)[0].(PathFigure.Segments)[0].(BezierSegment.Point1)" Storyboard.TargetName="rectWater">
				<EasingPointKeyFrame KeyTime="0" Value="29.4670623044173,6.50005833307902"/>
				<EasingPointKeyFrame KeyTime="0:0:0.4" Value="29.4674091339111,0.500399112701416"/>
				<EasingPointKeyFrame KeyTime="0:0:2" Value="208.800365447998,1.16672499974568"/>
				<EasingPointKeyFrame KeyTime="0:0:2.9" Value="208.133702596029,6.50005833307902"/>
			</PointAnimationUsingKeyFrames>
			<PointAnimationUsingKeyFrames Storyboard.TargetProperty="(Path.Data).(PathGeometry.Figures)[0].(PathFigure.Segments)[4].(BezierSegment.Point2)" Storyboard.TargetName="rectWater">
				<EasingPointKeyFrame KeyTime="0" Value="-0.927284648021063,6.49931837121645"/>
				<EasingPointKeyFrame KeyTime="0:0:0.4" Value="-0.926937818527222,0.499659150838852"/>
				<EasingPointKeyFrame KeyTime="0:0:2" Value="178.40601849556,1.16598503788312"/>
				<EasingPointKeyFrame KeyTime="0:0:2.9" Value="177.739354451498,6.49931828180949"/>
			</PointAnimationUsingKeyFrames>
			<PointAnimationUsingKeyFrames Storyboard.TargetProperty="(Path.Data).(PathGeometry.Figures)[0].(PathFigure.Segments)[4].(BezierSegment.Point3)" Storyboard.TargetName="rectWater">
				<EasingPointKeyFrame KeyTime="0" Value="13.0727027157942,6.4996592203776"/>
				<EasingPointKeyFrame KeyTime="0:0:0.4" Value="13.0730495452881,0.5"/>
				<EasingPointKeyFrame KeyTime="0:0:2" Value="192.406005859375,1.16632588704427"/>
				<EasingPointKeyFrame KeyTime="0:0:2.9" Value="191.739339192708,6.49965922037761"/>
			</PointAnimationUsingKeyFrames>
		</Storyboard>
	</UserControl.Resources>

    <Canvas x:Name="LayoutRoot"  >

        <Microsoft_Expression_Interactivity:Interaction.Behaviors>
            <Spritehand_PhysicsBehaviors:PhysicsControllerBehavior MousePickEnabled="True" TimeStep="0.03" />
        </Microsoft_Expression_Interactivity:Interaction.Behaviors>
        <Path x:Name="rectWater" Fill="#FF5084EB" Height="181.864" Canvas.Left="97.094" Opacity="0.5" Canvas.Top="223.667" UseLayoutRounding="False" Width="146.906" Canvas.ZIndex="500" Stretch="Fill">
        	<Path.Data>
        		<PathGeometry FillRule="EvenOdd">
        			<PathFigure IsFilled="True" IsClosed="True" StartPoint="13.0730800628662,0.5">
        				<BezierSegment Point3="203.268600463867,6.87417840957642" Point2="203.268600463867,6.87417554855347" Point1="29.4674396514893,0.500399112701416"/>
        				<LineSegment Point="203.268600463867,181.364273071289"/>
        				<LineSegment Point="0.544413566589355,181.364273071289"/>
        				<LineSegment Point="0.544413566589355,6.87417840957642"/>
        				<BezierSegment Point3="13.0730800628662,0.5" Point2="-0.926907658576965,0.499659150838852" Point1="0.544413566589355,6.87417554855347"/>
        			</PathFigure>
        		</PathGeometry>
        	</Path.Data>
    		<Microsoft_Expression_Interactivity:Interaction.Behaviors>
    			<Spritehand_PhysicsBehaviors:PhysicsFluidContainerBehavior/>
    		</Microsoft_Expression_Interactivity:Interaction.Behaviors>
    	</Path>
        <Path x:Name="ground" Stretch="Fill" Stroke="Black" Height="483.72" Width="793" UseLayoutRounding="False" Canvas.Left="2.5" Canvas.Top="-2.22" Data="M38.499752,659.50043 L36.499756,184.49989 C36.499756,184.49989 50.76363,160.5631 104.49973,220.49998 C156.49971,278.50043 78.499748,590.50037 135.49973,595.50037 C165.59825,598.14056 711.46942,558.96301 731.49951,553.50031 C748.86829,548.76337 751.35834,245.44116 753.49951,240.49997 C766.49951,210.49992 767.04663,197.61223 783.39301,193.89742 C805.39301,188.89778 828.49945,194.49991 828.49945,194.49991 L819.49945,662.50043 z" >
            <Path.Fill>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF8BBE86" Offset="0"/>
                    <GradientStop Color="#FF255821" Offset="0.996"/>
                </LinearGradientBrush>
            </Path.Fill>
            <Microsoft_Expression_Interactivity:Interaction.Behaviors>
            	<Spritehand_PhysicsBehaviors:PhysicsObjectBehavior IsStatic="True"/>
            </Microsoft_Expression_Interactivity:Interaction.Behaviors>
        </Path>
        <Rectangle x:Name="ramp" CacheMode="BitmapCache" Fill="#FFDDDE0E" Stroke="Black" Height="23" Width="180" Canvas.Left="64" Canvas.Top="80" >
            <Microsoft_Expression_Interactivity:Interaction.Behaviors>
            	<Spritehand_PhysicsBehaviors:PhysicsObjectBehavior/>
            </Microsoft_Expression_Interactivity:Interaction.Behaviors>
        </Rectangle>
        <Ellipse Fill="White" Stroke="Black" Height="23" Width="26" Canvas.Left="64" Canvas.Top="80" >
            <Microsoft_Expression_Interactivity:Interaction.Behaviors>
            	<Spritehand_PhysicsBehaviors:PhysicsJointBehavior BodyOne="ramp" BodyTwo="ground" CollisionGroup="2" AngleSpringEnabled="True" AngleSpringConstant="0.8"/>
            </Microsoft_Expression_Interactivity:Interaction.Behaviors>
        </Ellipse>
        <Path x:Name="pathFlipper" CacheMode="BitmapCache" Fill="#FFDDDE0E" Stretch="Fill" Stroke="Black" Height="66" Width="86" Canvas.Left="317" Canvas.Top="94" Data="M0.5,0.5 L27,0.5 L57,18 L85.5,0.5 L85.5,21 L63,40.5 L85.5,65.5 L63,65.5 L28.5,46.5 L0.5,65.5 L0.5,43.5 L19.5,22.5 z" UseLayoutRounding="False">
            <Microsoft_Expression_Interactivity:Interaction.Behaviors>
            	<Spritehand_PhysicsBehaviors:PhysicsObjectBehavior/>
            </Microsoft_Expression_Interactivity:Interaction.Behaviors>
        </Path>
        <Ellipse Fill="White" Stroke="Black" Height="23" Width="26" Canvas.Left="350" Canvas.Top="118">
            <Microsoft_Expression_Interactivity:Interaction.Behaviors>
            	<Spritehand_PhysicsBehaviors:PhysicsJointBehavior BodyOne="pathFlipper" BodyTwo="ground" CollisionGroup="2" AngleSpringEnabled="False" AngleSpringConstant="0.8"/>
            </Microsoft_Expression_Interactivity:Interaction.Behaviors>
        </Ellipse>
        <local:ucRagDoll Canvas.Left="216" Canvas.Top="-641" d:LayoutOverrides="Height"/>
        <TextBlock Height="36" Canvas.Left="24" TextWrapping="Wrap" Canvas.Top="430" Width="353" Foreground="#FFD0D0D0" FontWeight="Bold" FontSize="12" Canvas.ZIndex="1000"><Run Text="PHYSICS HELPER 4 FOR SILVERLIGHT + WP7 "/><LineBreak/><Run Text="USING FARSEER PHYSICS 3"/></TextBlock>
        <HyperlinkButton Content="www.andybeaulieu.com" Height="25" Canvas.Left="535" Canvas.Top="8" Width="202" TargetName="_blank" NavigateUri="http://www.andybeaulieu.com" Canvas.ZIndex="1000" Foreground="#FFD0D0D0" FontSize="16"/>
        <Button x:Name="btnAddBlock" Content="Add Block" Width="169" Canvas.Left="535" Canvas.Top="405" Click="btnAddBlock_Click" Height="67" Canvas.ZIndex="1000"/>
        <local:ucBlock Canvas.Left="564" Canvas.Top="-137"/>
        <Canvas x:Name="cnvFishHead" Height="50" Canvas.Left="136" Canvas.Top="141" Width="50">
        	<Microsoft_Expression_Interactivity:Interaction.Behaviors>
        		<Spritehand_PhysicsBehaviors:PhysicsObjectBehavior/>
        	</Microsoft_Expression_Interactivity:Interaction.Behaviors>
        	<Ellipse x:Name="weldObj1" Height="50" Width="50" CacheMode="BitmapCache">
        		<Ellipse.Fill>
        			<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        				<GradientStop Color="#FF88E276" Offset="0"/>
        				<GradientStop Color="#FF3C972A" Offset="0.987"/>
        			</LinearGradientBrush>
        		</Ellipse.Fill>
        	</Ellipse>
        	<Ellipse Height="21" Width="14" Canvas.Left="8" Canvas.Top="8" Fill="White"/>
        	<Ellipse Fill="Black" Height="12" Width="8" Canvas.Left="11" Canvas.Top="15"/>
        	<Ellipse Height="21" Width="14" Canvas.Left="24" Canvas.Top="8" Fill="White"/>
        	<Ellipse Fill="Black" Height="12" Width="8" Canvas.Left="27" Canvas.Top="15"/>
        </Canvas>
        <Canvas x:Name="cnvFishTail" Height="33" Canvas.Left="175" Canvas.Top="150" Width="41">
        	<Microsoft_Expression_Interactivity:Interaction.Behaviors>
        		<Spritehand_PhysicsBehaviors:PhysicsObjectBehavior/>
        	</Microsoft_Expression_Interactivity:Interaction.Behaviors>
        	<Path Data="M33,12.5 C33,19.403559 24.354504,20.379606 16.5,25 C7.9995961,30.000345 1,28.999941 0,12.5 C-0.81668621,-0.9752745 9.2725296,-0.41739285 17.499895,3.5007384 C27.999882,8.5011644 33,5.5964408 33,12.5 z" Height="26.577" Stretch="Fill" Width="33.046" Canvas.Top="1.071" UseLayoutRounding="False" Canvas.Left="-0.046">
        		<Path.Fill>
        			<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        				<GradientStop Color="#FF88E276" Offset="0"/>
        				<GradientStop Color="#FF3C972A" Offset="0.987"/>
        			</LinearGradientBrush>
        		</Path.Fill>
        	</Path>
        </Canvas>
        <Ellipse Fill="White" Stroke="Black" Height="23" Width="26" Canvas.Left="163" Canvas.Top="155">
        	<Microsoft_Expression_Interactivity:Interaction.Behaviors>
        		<Spritehand_PhysicsBehaviors:PhysicsJointBehavior BodyOne="cnvFishHead" BodyTwo="cnvFishTail" AngleSpringEnabled="False" AngleSpringConstant="0.8" IsWeldJoint="True"/>
        	</Microsoft_Expression_Interactivity:Interaction.Behaviors>
        </Ellipse>
        <Rectangle x:Name="pool1" Fill="#FFDDDE0E" Height="220" Canvas.Left="72" Canvas.Top="206" Width="26" Canvas.ZIndex="1000">
        	<Microsoft_Expression_Interactivity:Interaction.Behaviors>
        		<Spritehand_PhysicsBehaviors:PhysicsObjectBehavior IsStatic="True"/>
        	</Microsoft_Expression_Interactivity:Interaction.Behaviors>
        </Rectangle>
        <Rectangle x:Name="pool2" Fill="#FFDDDE0E" Height="220" Canvas.Left="242" Canvas.Top="206" Width="26" Canvas.ZIndex="1000">
        	<Microsoft_Expression_Interactivity:Interaction.Behaviors>
        		<Spritehand_PhysicsBehaviors:PhysicsObjectBehavior IsStatic="True"/>
        	</Microsoft_Expression_Interactivity:Interaction.Behaviors>
        </Rectangle>
        <Rectangle x:Name="pool3" Fill="#FFDDDE0E" Height="21" Canvas.Left="72" Canvas.Top="405" Width="172" Canvas.ZIndex="1000">
        	<Microsoft_Expression_Interactivity:Interaction.Behaviors>
        		<Spritehand_PhysicsBehaviors:PhysicsObjectBehavior IsStatic="True"/>
        	</Microsoft_Expression_Interactivity:Interaction.Behaviors>
        </Rectangle>
    </Canvas>
</UserControl>
